

#import <UIKit/UIKit.h>

#pragma mark - 协议

@class CMScrollview;
@class CMScrollCellView;
@protocol CMScrollviewDelegate <NSObject>

- (int)numberOfCellsWithContainer:(CMScrollview *)scrollview;
- (CMScrollCellView *)cellViewWithIndex:(int)index forContainer:(CMScrollview *)scrollview;
- (CGRect)cellFrameWithIndex:(int)index forContainer:(CMScrollview *)scrollview;

@end


@interface CMScrollview : UIScrollView

@property (nonatomic,assign) id <CMScrollviewDelegate> scrollUiDelegate;
@property (nonatomic,retain) NSMutableArray*    cellViews;

- (void)updateDisplay;

@end


////////////////////////////////////////////////////////
#pragma mark - 基础Cell类
@interface CMScrollCellItem : NSObject{
    id _target;
    SEL _selector;
    
}
@property (nonatomic,copy)  NSString*   cellViewClassName;
@property (nonatomic,assign)id          target;
@property (nonatomic,assign)SEL         selector;

- (void)addTarget:(id)target selector:(SEL)selector;

@end

@interface CMScrollCellView : UIView{
    CMScrollCellItem *_refScrollItem;
}
@property (nonatomic,retain)CMScrollCellItem *refScrollItem;
@end

